using MediatR;
using RBAC.ErrorCode;
using SmartHealthcare.Write.Api.DTo;

namespace SmartHealthcare.Write.Api.Application.Command.InpatientRegistry
{
    /// <summary>
    /// 出院结算命令
    /// </summary>
    public class DischargeSettlementCommand : IRequest<APIResult<DischargeSettlementResultDto>>
    {
        /// <summary>
        /// 病人卡号
        /// </summary>
        public string MedicalCard { get; set; } = string.Empty;

        /// <summary>
        /// 病人姓名
        /// </summary>
        public string PatientName { get; set; } = string.Empty;

        /// <summary>
        /// 住院登记ID
        /// </summary>
        public long InpatientRegistryId { get; set; }

        /// <summary>
        /// 操作人员
        /// </summary>
        public string? OperatorName { get; set; } = "system";

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remarks { get; set; } = string.Empty;

        /// <summary>
        /// 验证参数
        /// </summary>
        /// <returns></returns>
        public bool IsValid()
        {
            return !string.IsNullOrWhiteSpace(MedicalCard) 
                && !string.IsNullOrWhiteSpace(PatientName) 
                && InpatientRegistryId > 0;
        }
    }
} 